#!/bin/bash
#########################################################################
# File Name:    install.sh
# Author:       zero91
# mail:         jianzhang9102@gmail.com
# Created Time: Tue 17 Dec 2013 07:01:47 PM CST
#
# Description:  script to install linux software
#########################################################################

# sudo apt-get install autoconf
# sudo apt-get install libtool
cd $HOME

# install apache2
if [ ! -d "Web" ]; then
    mkdir "Web"
fi

cd Web

if [ ! -f "httpd-2.4.7.tar.gz" ]; then
    wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.7.tar.gz
fi

if [ -d "httpd-2.4.7" ]; then
    rm -rf httpd-2.4.7
fi

tar xzvf httpd-2.4.7.tar.gz
cd httpd-2.4.7

svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr
./buildconf
wget http://sourceforge.net/projects/pcre/files/latest/download

exit 0

tar xjvf download
mv pcre-* srclib/pcre
cd srclib/pcre
./configure --prefix=/usr/local

make
sudo make install

cd ../..

./configure --prefix=$HOME/Web/apache2 --with-included-apr --with-include-pcre
make
make install

